package com.chinadci.smartcommunitysystembackstage.mapper;

import com.chinadci.smartcommunitysystembackstage.entity.ScsFeedback;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.chinadci.smartcommunitysystembackstage.entity.ScsPhone;
import com.chinadci.smartcommunitysystembackstage.entity.ScsPositionType;
import com.chinadci.smartcommunitysystembackstage.entity.ScsUser;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Code Duck
 * @since 2021-04-13
 */
public interface ScsFeedbackMapper extends BaseMapper<ScsFeedback> {
    //显示全部意见反馈
    @Select("select * from scs_feedback where f_info like #{title}")
    @Results({
            @Result(id = true,column = "f_id",property = "fId"),
            @Result(column = "f_info",property = "fInfo"),
            @Result(column = "f_time",property = "fTime"),
            @Result(column = "f_state",property = "fState"),
            @Result(column = "u_id",property = "user",many =@Many(select = "Select"))
    })
    List<ScsFeedback> Find(String title);

    @Select("select * from scs_user where u_id=#{u_id}")
    List<ScsUser> Select(int id);
}
